import java.util.HashMap;

/**
 * @projectName: com.xiayuanxing.designPattern
 * @className: VarExpression
 * @author: xiayuanxing
 * @description: 变量解释器
 * @date: 2022/1/17 15:57
 * @version: 1.0
 */
public class VarExpression extends Expression{

    //key=a,key=b,key=c
    private String key;

    public VarExpression(String key) {
        this.key = key;
    }

    @Override
    public int interprete(HashMap<String, Integer> var) {
        return var.get(this.key);
    }
}
